package com.voja.mrvica2;

import java.io.FileInputStream;

import com.voja.mrvica2.remoteimage.RemoteImageZoom;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

public class Zoom extends Activity {
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                             WindowManager.LayoutParams.FLAG_FULLSCREEN);
        
        setContentView(R.layout.zoom_image);
        try {
            FileInputStream f      = openFileInput(RemoteImageZoom.BITMAP_FILENAME);
            Bitmap          bitmap = BitmapFactory.decodeStream(f);
            android.util.Log.w("voja", "Bitmap: " + bitmap);
            ImageView image = (ImageView)findViewById(R.id.image);
            image.setImageBitmap(bitmap);
        } catch (Exception e) {
            App.alert(e.getMessage());
            finish();
        }
    }
    
    public void closeZoom(View v) {
        finish();
    }
}
